<?php
/**
 * 用户列表
 */

use yii\widgets\LinkPager;
?>
<!--页面主要内容-->
<main class="lyear-layout-content">

    <div class="container-fluid">

        <div class="row">
            <div class="col-lg-12">
                <div class="card">
                    <div class="card-header">
                        <h4>用户列表</h4>
                        <div style="float: right"><a href="javascript:void(0)" title="添加" onclick="adminobj.add()"><strong style="font-size: 22px;font-weight:bolder;">+</strong></a></div>
                    </div>
                    <div class="card-body">
                        <div class="table-responsive">
                            <table class="table table-bordered">
                                <thead>
                                <tr>
                                    <th>用户编号</th>
                                    <th>用户名称</th>
                                    <th>添加时间</th>
                                    <th>到期时间</th>
                                    <th>操作</th>
                                    <th>链接地址</th>
                                    <th>续费</th>
                                </tr>
                                </thead>
                                <tbody>
                                <?php foreach ($models as $v){
                                    if ($v['code']==1 && $v['type']==0){
                                        $type = '启用';
                                    }else{
                                        $type = '停用';
                                    }
                                ?>
                                <tr>
                                    <th><?=$v['userid']?></th>
                                    <td><?=$v['username']?></td>
                                    <td><?=$v['time']?></td>
                                    <td><?=$v['due_time']?></td>
                                    <td style="text-align: center"><a style="float: left;" href="javascript:void(0)"  onclick="adminobj.switchs(<?=$v['userid']?>)"><?=$type?></a>|<a style="float: right;" href="javascript:void(0)" onclick="adminobj.add(<?=$v['userid']?>)">更新</a></td>
                                    <td style="text-align: center"><a href="javascript:void(0)"  onclick="adminobj.can(<?=$v['userid']?>)">查看</a></td>
                                    <td style="text-align: center"><input class="form-control js-datepicker" type="text"  name="due_time" placeholder="yyyy-mm-dd"  data-date-format="yyyy-mm-dd" onchange="adminobj.renew(this,<?=$v['userid']?>)" /></td>
                                    <input type="hidden" id="due_time"/>
                                </tr>
                                <?php } ?>
                                </tbody>
                            </table>
                            <div style="text-align: center;">
                                <?= LinkPager::widget([
                                    'pagination' =>$pages
                                ]); ?>
                            </div>
                        </div>

                    </div>
                </div>
            </div>
        </div>

    </div>
    <div id="content" class="content" style="display:none">
        <div id="Tcontent">
        </div>
        <div class="dialogModal_footer">
            <button type="button" data-dialogModalBut="ok">提交</button>
            <button type="button" data-dialogModalBut="cancel">关闭</button>
        </div>
    </div>
</main>
<!--End 页面主要内容-->
<!--<script type="text/javascript" src="/js/schedule.js"></script>-->